package com.hanoiwiki.model;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="COORDINATES")
public class Coordinates extends BaseObject {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	@Column(name="LONGTITUE")
	private Float longtitue;
	
	@Column(name="LATITUE")
	private Float latitue;
	
	@Column(name="RANGE")
	private Float range;
	
	@Column(name="UPDATED_TIME")
	private Date updatedTime;
	
	@Column(name="NOTE")
	private String note;
	
	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "BLOCKS_COORDINATES", joinColumns = {@JoinColumn(name = "COOR_ID")}
										, inverseJoinColumns={@JoinColumn(name = "BLOCK_ID")})
	private List<Blocks> blocks;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Float getLongtitue() {
		return longtitue;
	}

	public void setLongtitue(Float longtitue) {
		this.longtitue = longtitue;
	}

	public Float getLatitue() {
		return latitue;
	}

	public void setLatitue(Float latitue) {
		this.latitue = latitue;
	}

	public Float getRange() {
		return range;
	}

	public void setRange(Float range) {
		this.range = range;
	}

	public Date getUpdatedTime() {
		return updatedTime;
	}

	public void setUpdatedTime(Date updatedTime) {
		this.updatedTime = updatedTime;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public List<Blocks> getBlocks() {
		return blocks;
	}

	public void setBlocks(List<Blocks> blocks) {
		this.blocks = blocks;
	}
	
	
}
